import JSEncrypt from 'jsencrypt';
import Encrypt from 'encryptlong';

const crpytoConfig = {
    PUB_KEY: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmRbhEtr/sq6ylEt2ttlbeJVTcvVk0oeZZHZKCtGtdhAZ7Srl3iEIFLLmEZFfklA0XoOICS9xjZ/Y7ItUE27JlveBAnbxXaiHZplnWxJMBIlVUVARdiFEdCrhzFz5EmqDbHsoVqyjPUQSGMCeEIMfWGxynbfAkUApj7xyJphAQ1Z13dDwayQtmplatIf+2u/GzmVUaAUSPtqK9mPA8dqDOIxayFHEIu5MFKK+VeDoKxm6ek//Xpm1vv0+wGc+JFSPAT4WFK/Ng9ncI9AcV5b5bITuoWp8rZt/3kSzglnGQLGoW/vxvrvQEMcBu8T6WSSBG2+usKfjauyQE1clIKJa7QIDAQAB"
}

export function CryptoEncrypt(word) {
    const jsRsa = new Encrypt();
    jsRsa.setPublicKey(crpytoConfig.PUB_KEY);
    return jsRsa.encryptLong(JSON.stringify(word))
}
